import React from 'react';
import Swiper from '../swiper/swiper';
import request from 'umi-request';
import Sidebar from '../sidebar/sidebar';
import './homeview.scss'
import HomePanel from '../homepanel/homepanel';
import Homehot from '../homehot/homehot';
import Homebrand from '../homebrand/homebrand';
import Homegoods from '../homegoods/homegoods';
import Homespecial from '../homespecial/homespecial';



export default class Homeview extends React.Component{
    constructor(props){
        super(props)
        this.state={
            bannerList:[]
        }
    }
    componentWillMount(){
        request.get('https://apipc-xiaotuxian-front.itheima.net/home/banner').then((res)=>{
            if(res){
                this.setState({
                    bannerList:res.result
                })
            }
        })
    }
    render(){
        const {bannerList} = this.state
        return(
            <div className='homeView'>
                <Swiper bannerList={bannerList}></Swiper>
                <Sidebar className="Sidebar"></Sidebar>
                <HomePanel></HomePanel>
                <Homehot></Homehot>
                <Homebrand></Homebrand>
                <Homegoods></Homegoods>
                <Homespecial></Homespecial>
                
            </div>
        )
    }
}